Cycle (graph theory)

In graph theory, the term cycle may refer to a closed path. If repeated vertices are allowed, it is more often called a closed walk. If the path is a simple path, with no repeated vertices or edges other than the starting and ending vertices, it may also be called a simple cycle, circuit, circle, or polygon; see Cycle graph. A cycle in a directed graph is called a directed cycle.

The term cycle may also refer to:

Chordless cycles in a graph are sometimes called graph holes. A graph antihole is the complement of a graph hole.

Cycle detection

A graph has a cycle if and only if depth-first search produces a back edge.[1] This is true for both directed and undirected graphs. In the case of undirected graphs, only O(n) time is required, since at most n-1 edges can be tree edges (where n is the number of vertices). In the case of directed graphs, topological sorting algorithms will usually detect cycles too, since those are obstacles for topological order to exist.

See also

References

  1. ^ Tucker, Alan (2006). "Chapter 2: Covering Circuits and Graph Colorings". Applied Combinatorics (5th ed. ed.). Hoboken: John Wiley & sons. p. 49. ISBN 978-0-471-73507-8.